package com.woniu.client;



import com.woniu.dto.GoodsDto;
import com.woniu.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Set;

/**
 * 该类用于调用 pointsmall 服务的资源
 */
@FeignClient(name = "pointsmall-server",path = "/pointsmall")
public interface PointsmallClient {
    /**
     * 根据商品id 查询商品信息
     * @param id
     * @return
     */
    @GetMapping("/goods/goodsById/{id}")
    public Result<GoodsDto> goodsById(@PathVariable("id") Integer id);

    /**
     * 根据商品id 集合查询商品信息
     * @param ids
     * @return
     */
    @PostMapping("/goods/goodsByList")
    public Result<List<GoodsDto>> goodsByList(@RequestBody Set<Integer> ids);
}
